﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace ToolsCatalog.Model 
{
    
    public class Tool : ToolBase
    {
        int id;
        string xmlns;
        string name;
        List<string> description;
        List<string> parameters;

        System.Drawing.Image img;
        List<Part> parts;
        List<Tool> tools;
        public Tool()
        {
            description = new List<string>();
            parameters = new List<string>();
            parts = new List<Part>();
            tools = new List<Tool>();
        }
        #region properties
        public string Xmlns
        {
            get { return xmlns; }
            set { xmlns = value; }
        }

        public List<Part> Parts
        {
            get { return parts; }
            set { parts = value; }
        }
        public List<Tool> Tools
        {
            get { return tools; }
            set { tools = value; }
        }
        public System.Drawing.Image Img
        {
            get { return img; }
            set { img = value; }
        }
        public List<string> Parameters
        {
            get { return parameters; }
            set { parameters = value; }
        }
        public List<string> Description
        {
            get { return description; }
            set { description = value; }
        }
        public string DescriptionString
        {
            get
            {
                string tmpStr = "";
                foreach (string s in description)
                    tmpStr += s + " ";
                return tmpStr;
            }
        }
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        #endregion

        public override string ToString()
        {
            string tmpstr = "ToolName" + name + "\n";
            tmpstr += "___________\n";
            foreach (string dstr in description)
                tmpstr += dstr + "\n";
            foreach (Part p in parts)
            {
                tmpstr += p.ToString();
            }
            return tmpstr;
        }
    }
}
